<?php if (!defined ('TYPO3_MODE')) 	die ('Access denied.'); ?>

<br /><hr /><br />

<?php if(!empty($_POST)): ?>
	<pre><?php print_r($_POST) ?></pre>
	<?php $this->assign($_POST); ?>
<?php endif; ?>

<?php $form = $helper->form(); ?>
<?php $form->setId('testid')->setClass('testclass') ?>
<?php echo $form->start($_SERVER['REQUEST_URI'], 'post') ?>
<?php echo $form->text('text', $this->text) ?><br />
<?php echo $form->password('password', $this->password) ?><br />
<?php echo $form->textarea('textarea', $this->textarea) ?><br />
<?php echo $form->select('select1', $this->select1, array('', 'abc', 'def', 'ghi', 'jkl')) ?><br />
<?php echo $form->select('select2', $this->select2, array('abc' => 'ABC', 'def' => 'DEF', 'ghi' => 'GHI', 'jkl' => 'JKL'), array('multiple' => 'multiple')) ?><br />

<?php echo $form->radio(
	'radio1',
	$this->radio1,
	array(
		'abc' => 'ABC',
		'def' => 'DEF',
		'ghi' => 'GHI',
		'jkl' => 'JKL')
) ?><br />

<?php echo $form->radio(
	'radio2',
	$this->radio2,
	array(
		array('value' => 'abc', 'label' => 'ABC', 'class' => 'test-abc'),
		array('value' => 'def', 'label' => 'DEF', 'disabled' => 'disabled'),
		array('value' => 'ghi', 'label' => 'GHI', 'class' => 'test-ghi', 'disabled' => 'disabled'),
		array('value' => 'jkl', 'label' => 'JKL')
	),
	array(
		'class' => 'test-radio2'
	)
) ?><br />

<?php echo $form->checkbox('checkbox1', $this->checkbox1, 'checkbox1_value') ?> Testlabel<br />
<br />
<?php echo $form->multiCheckbox('checkbox2', $this->checkbox2, array('abc' => 'ABC', 'def' => 'DEF', 'ghi' => 'GHI', 'jkl' => 'JKL')) ?><br />
<?php echo $form->submit('submit', 'Submit') ?><br />
<?php echo $form->reset('reset', 'Reset') ?><br />
<?php echo $form->button('button', 'Button') ?><br />
<?php echo $form->image('image', 'typo3conf/ext/zlibtest/pi1/res/submit_button.gif', 'Image') ?><br />
<?php echo $form->file('file') ?><br />
<?php echo $form->hidden('hidden', 'Hidden') ?>
<?php echo $form->end() ?>



<h2>Example 1: Using a foreach</h2>
<?php if ($this->books): ?>

    <table border="1">

        <tr>
            <th>Title</th>
            <th>Author</th>
        </tr>

        <?php foreach ($this->books as $key => $val): ?>
        <tr>
            <td><?php echo $helper->escape($val['title']) ?></td>
            <td><?php echo $helper->escape($val['author']) ?></td>
        </tr>
        <?php endforeach; ?>

    </table>

<?php else: ?>

    <p>There are no books to display.</p>

<?php endif; ?>